package characterCreator;
import java.awt.event.ActionEvent;
import java.util.Arrays;
import java.util.Random;

import javax.swing.AbstractAction;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.LayoutStyle;
import javax.swing.SpinnerListModel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class mainFrame extends javax.swing.JFrame {
	private JMenuBar mainMenu;
	private JLabel intelligenceLabel;
	private JTextPane svDragonPane;
	private JTextPane svParalysisPane;
	private JTextPane svMagicWandPane;
	private JTextPane svPoisonPane;
	private JLabel svMagicWandLabel;
	private JTextPane tHAC0TextPane;
	private JLabel tHAC0Label;
	private JTextPane hpTextPane;
	private JLabel hpLabel;
	private AbstractAction rollAbilitiesJButton;
	private AbstractAction expFieldAction;
	private AbstractAction levelTextFieldAction;
	private JTextField levelTextField;
	private AbstractAction alignmentComboBoxAction;
	private AbstractAction sexComboBoxAction;
	private AbstractAction classComboBoxAction;
	private AbstractAction characterNameFieldAction;
	private AbstractAction playerNameFieldAction;
	private JPanel classPanel;
	private JButton rollAbilitiesButton;
	private JPanel savingThrowsPanel;
	private JLabel svSpellLabel;
	private JLabel svDragonLabel;
	private JLabel svParalysisLabel;
	private JLabel svPoisonLabel;
	private JTextPane svSpellPane;
	private JLabel savingThrowsLabel;
	private JTextPane expBonusPane;
	private JLabel expBonusLabel;
	private JTextPane primeRequisitePane;
	private JLabel primeRequisiteLabel;
	private JComboBox classComboBox;
	private JLabel classLabel;
	private JLabel adjustmentsLabel;
	private JLabel abilitiesLabel;
	private JTextPane charismaBonusPanel;
	private JTextPane constitutionBonusPanel;
	private JTextPane dexterityBonusPanel;
	private JTextPane wisdomBonusPanel;
	private JTextPane intelligenceBonusPanel;
	private JTextPane strengthBonusPanel;
	private JPanel abilityJPanel;
	private JLabel charismaLabel;
	private JLabel constitutionLabel;
	private JLabel dexterityLabel;
	private JLabel wisdomLabel;
	private JLabel strengthLabel;
	private JTextField charismaTextField;
	private JTextField constitutionTextField;
	private JTextField dexterityTextField;
	private JTextField wisdomTextField;
	private JTextField intelligenceTextField;
	private JTextField strengthTextField;
	private JPanel topJPanel;
	private JTextField expField;
	private JLabel expLabel;
	private AbstractAction exitMainMenuAction;
	private JTextField playerNameField;
	private JLabel levelLabel;
	private JComboBox sexComboBox;
	private JComboBox alignmentComboBox;
	private JLabel alignmentLabel;
	private JLabel sexLabel;
	private JLabel characterNameLabel;
	private JTextField characterNameField;
	private JLabel playerNameLabel;
	private JMenuItem exitMenuItem;
	private JMenu fileMenu;
	private Die die = new Die();
	private Character baseCharacter = new Character(); 

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				mainFrame inst = new mainFrame();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
				inst.setTitle("Classic D&D Character Creator 0.01");
			}

		});
	}
	
	public mainFrame() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(getJPanel1(), GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE)
				.addComponent(getJPanel1xxx(), GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				.addGroup(thisLayout.createParallelGroup()
				    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				        .addComponent(getTHAC0Label(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)
				        .addComponent(getAdjustmentsLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
				        .addComponent(getAbilitiesLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				    .addGroup(thisLayout.createSequentialGroup()
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				        .addGroup(thisLayout.createParallelGroup()
				            .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                .addComponent(getJPanel1xx(), GroupLayout.PREFERRED_SIZE, 163, GroupLayout.PREFERRED_SIZE)
				                .addGap(39))
				            .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                .addComponent(getTHAC0TextPane(), GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				                .addGap(12)
				                .addComponent(getJPanel1x(), GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE)))))
				.addGap(18)
				.addComponent(getRollAbilitiesButton(), GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE));
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(thisLayout.createParallelGroup()
				    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				        .addGroup(thisLayout.createParallelGroup()
				            .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                .addComponent(getAbilitiesLabel(), GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)
				                .addGap(42)
				                .addComponent(getAdjustmentsLabel(), GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
				            .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                .addComponent(getJPanel1x(), GroupLayout.PREFERRED_SIZE, 126, GroupLayout.PREFERRED_SIZE)
				                .addGap(19))
				            .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				                .addComponent(getRollAbilitiesButton(), GroupLayout.PREFERRED_SIZE, 128, GroupLayout.PREFERRED_SIZE)
				                .addGap(17)))
				        .addGap(83)
				        .addComponent(getJPanel1xx(), GroupLayout.PREFERRED_SIZE, 176, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				        .addComponent(getTHAC0Label(), GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
				        .addComponent(getTHAC0TextPane(), GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
				        .addGap(0, 104, Short.MAX_VALUE))
				    .addGroup(GroupLayout.Alignment.LEADING, thisLayout.createSequentialGroup()
				        .addComponent(getJPanel1(), GroupLayout.PREFERRED_SIZE, 605, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE))
				    .addComponent(getJPanel1xxx(), GroupLayout.Alignment.LEADING, 0, 609, Short.MAX_VALUE))
				.addContainerGap(16, 16));
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Classic D&D Character Creator 0.01");
			{
				mainMenu = new JMenuBar();
				setJMenuBar(mainMenu);
				{
					fileMenu = new JMenu();
					mainMenu.add(fileMenu);
					fileMenu.setText("File");
					{
						exitMenuItem = new JMenuItem();
						fileMenu.add(exitMenuItem);
						exitMenuItem.setText("Exit");
						exitMenuItem.setAction(getExitMainMenuAction());

					}
				}
			}
			pack();
			this.setSize(653, 454);
			updateAllFields();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	/**
	* This method should return an instance of this class which does 
	* NOT initialize it's GUI elements. This method is ONLY required by
	* Jigloo if the superclass of this class is abstract or non-public. It 
	* is not needed in any other situation.
	 */
	public static Object getGUIBuilderInstance() {
		return getGUIBuilderInstance();
	}
	
	/**
	 * This constructor is used by the getGUIBuilderInstance method to
	 * provide an instance of this class which has not had it's GUI elements
	 * initialized (ie, initGUI is not called in this constructor).
	 */
	public mainFrame(Boolean initGUI) {
		super();
	}
	
	private AbstractAction getExitMainMenuAction() {
		if(exitMainMenuAction == null) {
			exitMainMenuAction = new AbstractAction("Exit", null) {
				public void actionPerformed(ActionEvent evt) {
					mainFrame.this.dispose();
				}
			};
		}
		return exitMainMenuAction;
	}
	
	private JLabel getPlayerNameLabel() {
		if(playerNameLabel == null) {
			playerNameLabel = new JLabel();
			playerNameLabel.setText("Player Name");
		}
		return playerNameLabel;
	}
	
	private JTextField getPlayerNameField() {
		if(playerNameField == null) {
			playerNameField = new JTextField();
			playerNameField.setAction(getPlayerNameFieldAction());
			playerNameField.setText(baseCharacter.getPlayer());
		}
		return playerNameField;
	}
	
	private JTextField getCharacterNameField() {
		if(characterNameField == null) {
			characterNameField = new JTextField();
			characterNameField.setAction(getCharacterNameFieldAction());
		}
		return characterNameField;
	}
	
	private JLabel getCharacterNameLabel() {
		if(characterNameLabel == null) {
			characterNameLabel = new JLabel();
			characterNameLabel.setText("Character");
		}
		return characterNameLabel;
	}
	
	private JLabel getSexLabel() {
		if(sexLabel == null) {
			sexLabel = new JLabel();
			sexLabel.setText("Sex");
		}
		return sexLabel;
	}
	
	private JLabel getAlignmentLabel() {
		if(alignmentLabel == null) {
			alignmentLabel = new JLabel();
			alignmentLabel.setText("Alignment");
		}
		return alignmentLabel;
	}
	
	private JComboBox getAlignmentComboBox() {
		if(alignmentComboBox == null) {
			ComboBoxModel alignmentComboBoxModel = 
				new DefaultComboBoxModel(
						new Alignment[] { Alignment.Lawful, Alignment.Neutral, Alignment.Chaotic });
			alignmentComboBox = new JComboBox();
			alignmentComboBox.setModel(alignmentComboBoxModel);
			alignmentComboBox.setAction(getAlignmentComboBoxAction());
		}
		return alignmentComboBox;
	}
	
	private JComboBox getSexComboBox() {
		if(sexComboBox == null) {
			ComboBoxModel sexComboBoxModel = 
				new DefaultComboBoxModel(
						new Sex[] { Sex.Male, Sex.Female, Sex.Unknown });
			sexComboBox = new JComboBox();
			sexComboBox.setModel(sexComboBoxModel);
			sexComboBox.setAction(getSexComboBoxAction());
		}
		return sexComboBox;
	}
	
	private JLabel getLevelLabel() {
		if(levelLabel == null) {
			levelLabel = new JLabel();
			levelLabel.setText("Level");
		}
		return levelLabel;
	}
	
	private JLabel getExpLabel() {
		if(expLabel == null) {
			expLabel = new JLabel();
			expLabel.setText("Exp");
		}
		return expLabel;
	}

	private JTextField getExpField() {
		if(expField == null) {
			expField = new JTextField();
			expField.setText(String.valueOf(baseCharacter.getExp()));
			expField.setAction(getExpFieldAction());
		}
		return expField;
	}
	
	private JPanel getJPanel1() {
		if(topJPanel == null) {
			topJPanel = new JPanel();
			GroupLayout jPanel1Layout = new GroupLayout((JComponent)topJPanel);
			topJPanel.setLayout(jPanel1Layout);
			jPanel1Layout.setHorizontalGroup(jPanel1Layout.createSequentialGroup()
				.addGroup(jPanel1Layout.createParallelGroup()
				    .addComponent(getCharacterNameLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getPlayerNameLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout.createParallelGroup()
				    .addComponent(getCharacterNameField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 239, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getPlayerNameField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 239, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout.createParallelGroup()
				    .addComponent(getAlignmentLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
				        .addComponent(getSexLabel(), GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)
				        .addGap(46)))
				.addGroup(jPanel1Layout.createParallelGroup()
				    .addComponent(getAlignmentComboBox(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getSexComboBox(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout.createParallelGroup()
				    .addComponent(getExpLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getLevelLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE))
				.addGroup(jPanel1Layout.createParallelGroup()
				    .addComponent(getExpField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
				        .addComponent(getLevelTextField(), GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
				        .addGap(0, 15, Short.MAX_VALUE))));
			jPanel1Layout.setVerticalGroup(jPanel1Layout.createSequentialGroup()
				.addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(getPlayerNameField(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getPlayerNameLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getSexLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getSexComboBox(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getLevelLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getLevelTextField(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				.addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(getCharacterNameField(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getCharacterNameLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getAlignmentLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getAlignmentComboBox(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getExpLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getExpField(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
		}
		return topJPanel;
	}
	
	private JTextField getStrengthTextField() {
		if(strengthTextField == null) {
			strengthTextField = new JTextField();
			strengthTextField.setText("0");
		}
		return strengthTextField;
	}
	
	private JTextField getIntelligenceTextField() {
		if(intelligenceTextField == null) {
			intelligenceTextField = new JTextField();
			intelligenceTextField.setText("0");
		}
		return intelligenceTextField;
	}
	
	private JTextField getWisdomTextField() {
		if(wisdomTextField == null) {
			wisdomTextField = new JTextField();
			wisdomTextField.setText("0");
		}
		return wisdomTextField;
	}
	
	private JTextField getDexterityTextField() {
		if(dexterityTextField == null) {
			dexterityTextField = new JTextField();
			dexterityTextField.setText("0");
		}
		return dexterityTextField;
	}
	
	private JTextField getConstitutionTextField() {
		if(constitutionTextField == null) {
			constitutionTextField = new JTextField();
			constitutionTextField.setText("0");
		}
		return constitutionTextField;
	}
	
	private JTextField getCharismaTextField() {
		if(charismaTextField == null) {
			charismaTextField = new JTextField();
			charismaTextField.setText("0");
		}
		return charismaTextField;
	}
	
	private JLabel getStrengthLabel() {
		if(strengthLabel == null) {
			strengthLabel = new JLabel();
			strengthLabel.setText("STR");
		}
		return strengthLabel;
	}
	
	private JLabel getIntelligenceLabel() {
		if(intelligenceLabel == null) {
			intelligenceLabel = new JLabel();
			intelligenceLabel.setText("INT");
		}
		return intelligenceLabel;
	}
	
	private JLabel getWisdomLabel() {
		if(wisdomLabel == null) {
			wisdomLabel = new JLabel();
			wisdomLabel.setText("WIS");
		}
		return wisdomLabel;
	}
	
	private JLabel getDexterityLabel() {
		if(dexterityLabel == null) {
			dexterityLabel = new JLabel();
			dexterityLabel.setText("DEX");
		}
		return dexterityLabel;
	}
	
	private JLabel getConstitutionLabel() {
		if(constitutionLabel == null) {
			constitutionLabel = new JLabel();
			constitutionLabel.setText("CON");
		}
		return constitutionLabel;
	}
	
	private JLabel getCharismaLabel() {
		if(charismaLabel == null) {
			charismaLabel = new JLabel();
			charismaLabel.setText("CHA");
		}
		return charismaLabel;
	}
	
	private JPanel getJPanel1x() {
		if(abilityJPanel == null) {
			abilityJPanel = new JPanel();
			GroupLayout jPanel1Layout1 = new GroupLayout((JComponent)abilityJPanel);
			abilityJPanel.setLayout(jPanel1Layout1);
			jPanel1Layout1.setHorizontalGroup(jPanel1Layout1.createSequentialGroup()
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getCharismaTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getConstitutionTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getDexterityTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getWisdomTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getIntelligenceTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getStrengthTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getCharismaLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getConstitutionLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getDexterityLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getWisdomLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getIntelligenceLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getStrengthLabel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getStrengthBonusPanel(), GroupLayout.Alignment.LEADING, 0, 27, Short.MAX_VALUE)
				    .addComponent(getIntelligenceBonusPanel(), GroupLayout.Alignment.LEADING, 0, 27, Short.MAX_VALUE)
				    .addComponent(getWisdomBonusPanel(), GroupLayout.Alignment.LEADING, 0, 27, Short.MAX_VALUE)
				    .addComponent(getDexterityBonusPanel(), GroupLayout.Alignment.LEADING, 0, 27, Short.MAX_VALUE)
				    .addComponent(getConstitutionBonusPanel(), GroupLayout.Alignment.LEADING, 0, 27, Short.MAX_VALUE)
				    .addComponent(getCharismaBonusPanel(), GroupLayout.Alignment.LEADING, 0, 27, Short.MAX_VALUE))
				.addContainerGap(18, 18));
			jPanel1Layout1.setVerticalGroup(jPanel1Layout1.createSequentialGroup()
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getStrengthBonusPanel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout1.createSequentialGroup()
				        .addComponent(getStrengthLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
				    .addComponent(getStrengthTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getIntelligenceBonusPanel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout1.createSequentialGroup()
				        .addComponent(getIntelligenceLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
				    .addComponent(getIntelligenceTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getWisdomBonusPanel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout1.createSequentialGroup()
				        .addComponent(getWisdomLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
				    .addComponent(getWisdomTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getDexterityBonusPanel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout1.createSequentialGroup()
				        .addComponent(getDexterityLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
				    .addComponent(getDexterityTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getConstitutionBonusPanel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout1.createSequentialGroup()
				        .addComponent(getConstitutionLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
				    .addComponent(getConstitutionTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout1.createParallelGroup()
				    .addComponent(getCharismaBonusPanel(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout1.createSequentialGroup()
				        .addComponent(getCharismaLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE))
				    .addComponent(getCharismaTextField(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
		}
		return abilityJPanel;
	}
	
	private JTextPane getStrengthBonusPanel() {
		if(strengthBonusPanel == null) {
			strengthBonusPanel = new JTextPane();
		}
		return strengthBonusPanel;
	}
	
	private JTextPane getIntelligenceBonusPanel() {
		if(intelligenceBonusPanel == null) {
			intelligenceBonusPanel = new JTextPane();
		}
		return intelligenceBonusPanel;
	}
	
	private JTextPane getWisdomBonusPanel() {
		if(wisdomBonusPanel == null) {
			wisdomBonusPanel = new JTextPane();
		}
		return wisdomBonusPanel;
	}
	
	private JTextPane getDexterityBonusPanel() {
		if(dexterityBonusPanel == null) {
			dexterityBonusPanel = new JTextPane();
		}
		return dexterityBonusPanel;
	}
	
	private JTextPane getConstitutionBonusPanel() {
		if(constitutionBonusPanel == null) {
			constitutionBonusPanel = new JTextPane();
		}
		return constitutionBonusPanel;
	}
	
	private JTextPane getCharismaBonusPanel() {
		if(charismaBonusPanel == null) {
			charismaBonusPanel = new JTextPane();
		}
		return charismaBonusPanel;
	}
	
	private JLabel getAbilitiesLabel() {
		if(abilitiesLabel == null) {
			abilitiesLabel = new JLabel();
			abilitiesLabel.setText("Abilities");
			abilitiesLabel.setFont(new java.awt.Font("Segoe UI",0,10));
		}
		return abilitiesLabel;
	}
	
	private JLabel getAdjustmentsLabel() {
		if(adjustmentsLabel == null) {
			adjustmentsLabel = new JLabel();
			adjustmentsLabel.setText("Adjustments");
			adjustmentsLabel.setFont(new java.awt.Font("Segoe UI",0,10));
		}
		return adjustmentsLabel;
	}
	
	private JLabel getClassLabel() {
		if(classLabel == null) {
			classLabel = new JLabel();
			classLabel.setText("Class");
		}
		return classLabel;
	}
	
	private JComboBox getClassComboBox() {
		if(classComboBox == null) {
			ComboBoxModel classComboBoxModel = 
				new DefaultComboBoxModel(
						new ClassType[] { ClassType.Cleric, ClassType.Druid, ClassType.Dwarf,
										ClassType.Elf, ClassType.Fighter, ClassType.Halfling,
										ClassType.MagicUser, ClassType.Mystic, ClassType.Thief});
			classComboBox = new JComboBox();
			classComboBox.setModel(classComboBoxModel);
			classComboBox.setAction(getClassComboBoxAction());
		}
		return classComboBox;
	}
	
	private JLabel getPrimeRequisiteLabel() {
		if(primeRequisiteLabel == null) {
			primeRequisiteLabel = new JLabel();
			primeRequisiteLabel.setText("Prime Requisite");
		}
		return primeRequisiteLabel;
	}
	
	private JTextPane getPrimeRequisitePane() {
		if(primeRequisitePane == null) {
			primeRequisitePane = new JTextPane();
		}
		return primeRequisitePane;
	}
	
	private JLabel getExpBonusLabel() {
		if(expBonusLabel == null) {
			expBonusLabel = new JLabel();
			expBonusLabel.setText("XP Bonus");
		}
		return expBonusLabel;
	}
	
	private JTextPane getExpBonusPane() {
		if(expBonusPane == null) {
			expBonusPane = new JTextPane();
		}
		return expBonusPane;
	}
	
	private JLabel getSavingThrowsLabel() {
		if(savingThrowsLabel == null) {
			savingThrowsLabel = new JLabel();
			savingThrowsLabel.setText("Saving Throws");
			savingThrowsLabel.setFont(new java.awt.Font("Segoe UI",0,10));
		}
		return savingThrowsLabel;
	}
	
	private JTextPane getSvPoisonPane() {
		if(svPoisonPane == null) {
			svPoisonPane = new JTextPane();
		}
		return svPoisonPane;
	}
	
	private JTextPane getSvMagicWandPane() {
		if(svMagicWandPane == null) {
			svMagicWandPane = new JTextPane();
		}
		return svMagicWandPane;
	}
	
	private JTextPane getSvParalysisPane() {
		if(svParalysisPane == null) {
			svParalysisPane = new JTextPane();
		}
		return svParalysisPane;
	}
	
	private JTextPane getSvDragonPane() {
		if(svDragonPane == null) {
			svDragonPane = new JTextPane();
		}
		return svDragonPane;
	}
	
	private JTextPane getSvSpellPane() {
		if(svSpellPane == null) {
			svSpellPane = new JTextPane();
		}
		return svSpellPane;
	}
	
	private JLabel getSvPoisonLabel() {
		if(svPoisonLabel == null) {
			svPoisonLabel = new JLabel();
			svPoisonLabel.setText("Death Ray or Poison");
		}
		return svPoisonLabel;
	}
	
	private JLabel getSvMagicWandLabel() {
		if(svMagicWandLabel == null) {
			svMagicWandLabel = new JLabel();
			svMagicWandLabel.setText("Magic Wands");
		}
		return svMagicWandLabel;
	}
	
	private JLabel getSvParalysisLabel() {
		if(svParalysisLabel == null) {
			svParalysisLabel = new JLabel();
			svParalysisLabel.setText("Paralysis or Turn to Stone");
		}
		return svParalysisLabel;
	}
	
	private JLabel getSvDragonLabel() {
		if(svDragonLabel == null) {
			svDragonLabel = new JLabel();
			svDragonLabel.setText("Dragon Breath");
		}
		return svDragonLabel;
	}
	
	private JLabel getSvSpellLabel() {
		if(svSpellLabel == null) {
			svSpellLabel = new JLabel();
			svSpellLabel.setText("Rod, Staff, or Spell");
		}
		return svSpellLabel;
	}
	
	private JPanel getJPanel1xx() {
		if(savingThrowsPanel == null) {
			savingThrowsPanel = new JPanel();
			GroupLayout jPanel1Layout2 = new GroupLayout((JComponent)savingThrowsPanel);
			savingThrowsPanel.setLayout(jPanel1Layout2);
			jPanel1Layout2.setVerticalGroup(jPanel1Layout2.createSequentialGroup()
				.addGroup(jPanel1Layout2.createSequentialGroup()
				    .addComponent(getSavingThrowsLabel(), GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
				.addGroup(jPanel1Layout2.createParallelGroup()
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvPoisonLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvPoisonPane(), GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout2.createParallelGroup()
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvMagicWandLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvMagicWandPane(), GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout2.createParallelGroup()
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvParalysisLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvParalysisPane(), GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout2.createParallelGroup()
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvDragonLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvDragonPane(), GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)))
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addGroup(jPanel1Layout2.createParallelGroup()
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvSpellLabel(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSvSpellPane(), GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE))));
			jPanel1Layout2.setHorizontalGroup(jPanel1Layout2.createSequentialGroup()
				.addGroup(jPanel1Layout2.createParallelGroup()
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addGroup(jPanel1Layout2.createParallelGroup()
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvSpellPane(), GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvDragonPane(), GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvParalysisPane(), GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvMagicWandPane(), GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvPoisonPane(), GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)))
				        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				        .addGroup(jPanel1Layout2.createParallelGroup()
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvSpellLabel(), GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvDragonLabel(), GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvParalysisLabel(), GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvMagicWandLabel(), GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE))
				            .addGroup(jPanel1Layout2.createSequentialGroup()
				                .addComponent(getSvPoisonLabel(), GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE))))
				    .addGroup(jPanel1Layout2.createSequentialGroup()
				        .addComponent(getSavingThrowsLabel(), GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE))));
		}
		return savingThrowsPanel;
	}
	
	private JButton getRollAbilitiesButton() {
		if(rollAbilitiesButton == null) {
			rollAbilitiesButton = new JButton();
			rollAbilitiesButton.setText("Roll Abilities");
			rollAbilitiesButton.setAction(getRollAbilitiesJButton());
		}
		return rollAbilitiesButton;
	}
	
	private JPanel getJPanel1xxx() {
		if(classPanel == null) {
			classPanel = new JPanel();
			GroupLayout jPanel1Layout3 = new GroupLayout((JComponent)classPanel);
			classPanel.setLayout(jPanel1Layout3);
			jPanel1Layout3.setHorizontalGroup(jPanel1Layout3.createSequentialGroup()
				.addComponent(getClassLabel(), GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(getClassComboBox(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(getPrimeRequisiteLabel(), GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
				.addGap(8)
				.addComponent(getPrimeRequisitePane(), GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(getExpBonusLabel(), GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(getExpBonusPane(), GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(getHpLabel(), GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(getHpTextPane(), GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE));
			jPanel1Layout3.setVerticalGroup(jPanel1Layout3.createParallelGroup()
				.addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout3.createParallelGroup(GroupLayout.Alignment.BASELINE)
				    .addComponent(getHpLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getClassLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getPrimeRequisiteLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getClassComboBox(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getExpBonusLabel(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
				.addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout3.createParallelGroup()
				    .addComponent(getHpTextPane(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getExpBonusPane(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
				    .addComponent(getPrimeRequisitePane(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)));
		}
		return classPanel;
	}
	
	private AbstractAction getPlayerNameFieldAction() {
		if(playerNameFieldAction == null) {
			playerNameFieldAction = new AbstractAction("playerNameFieldAction", null) {
				public void actionPerformed(ActionEvent evt) {
					baseCharacter.setPlayer(playerNameField.getText());
					System.out.println("playerNameFieldAction: " + baseCharacter.getPlayer());
					updateAllFields();
				}
			};
		}
		return playerNameFieldAction;
	}
	
	private AbstractAction getCharacterNameFieldAction() {
		if(characterNameFieldAction == null) {
			characterNameFieldAction = new AbstractAction("characterNameFieldAction", null) {
				public void actionPerformed(ActionEvent evt) {
					baseCharacter.setName(characterNameField.getText());
					System.out.println("characterNameField: " + baseCharacter.getName());
					updateAllFields();
				}
			};
		}
		return characterNameFieldAction;
	}
	
	private AbstractAction getClassComboBoxAction() {
		if(classComboBoxAction == null) {
			classComboBoxAction = new AbstractAction("classComboBoxAction", null) {
				public void actionPerformed(ActionEvent evt) {
					switch ((ClassType) classComboBox.getSelectedItem()) {
					case Cleric:
						baseCharacter = new Cleric(baseCharacter);
						break;
					case Dwarf:
						baseCharacter = new Dwarf(baseCharacter);
						break;
					case Elf:
						baseCharacter = new Elf(baseCharacter);
						break;
					case Fighter:
						baseCharacter = new Fighter(baseCharacter);
						break;
					}
					updateAllFields();
					System.out.println("classComboBox: " + baseCharacter.getType());
					
				}
			};
		}
		return classComboBoxAction;
	}
	
	private AbstractAction getSexComboBoxAction() {
		if(sexComboBoxAction == null) {
			sexComboBoxAction = new AbstractAction("sexComboBoxAction", null) {
				public void actionPerformed(ActionEvent evt) {
					baseCharacter.setSex((Sex) sexComboBox.getSelectedItem());
					System.out.println("sexComboBox: " + baseCharacter.getSex());
					updateAllFields();
				}
			};
		}
		return sexComboBoxAction;
	}
	
	private AbstractAction getAlignmentComboBoxAction() {
		if(alignmentComboBoxAction == null) {
			alignmentComboBoxAction = new AbstractAction("alignmentComboBoxAction", null) {
				public void actionPerformed(ActionEvent evt) {
					baseCharacter.setAlignment((Alignment) alignmentComboBox.getSelectedItem());
					System.out.println("alignmentComboBoxAction: " + baseCharacter.getAlignment());
				}
			};
		}
		return alignmentComboBoxAction;
	}
	
	private JTextField getLevelTextField() {
		if(levelTextField == null) {
			levelTextField = new JTextField();
			levelTextField.setText(String.valueOf(baseCharacter.getLevel()));
			levelTextField.setAction(getLevelTextFieldAction());
		}
		return levelTextField;
	}
	
	private AbstractAction getLevelTextFieldAction() {
		if(levelTextFieldAction == null) {
			levelTextFieldAction = new AbstractAction("levelTextFieldAction", null) {
				public void actionPerformed(ActionEvent evt) {
					baseCharacter.setLevel(Integer.parseInt(levelTextField.getText()));
					updateAllFields();
					System.out.println("levelTextField: " + baseCharacter.getLevel());
					System.out.println(baseCharacter.getSave(SavingThrow.svPoison));
					
				}
			};
		}
		return levelTextFieldAction;
	}
	
	private AbstractAction getExpFieldAction() {
		if(expFieldAction == null) {
			expFieldAction = new AbstractAction("expFieldAction", null) {
				public void actionPerformed(ActionEvent evt) {
					updateAllFields();
				}
			};
		}
		return expFieldAction;
	}

	private void updateAllFields() {
		this.playerNameField.setText(baseCharacter.getPlayer());
		this.characterNameField.setText(baseCharacter.getName());
		this.sexComboBox.setSelectedItem(baseCharacter.getSex());
		this.alignmentComboBox.setSelectedItem(baseCharacter.getAlignment());
		this.classComboBox.setSelectedItem(baseCharacter.getType());
		this.levelTextField.setText(String.valueOf(baseCharacter.getLevel()));
		
		this.primeRequisitePane.setText(baseCharacter.getPrimeRequisite().toString());
		if (baseCharacter.getPrimeRequisite(1) != null) {
			this.primeRequisitePane.setText(this.primeRequisitePane.getText().concat(", " + baseCharacter.getPrimeRequisite(1).toString()));
		}
		
		this.tHAC0TextPane.setText(String.valueOf(baseCharacter.getTHAC0()));
		this.expField.setText(String.valueOf(baseCharacter.getExp()));
		this.expBonusPane.setText(String.valueOf(baseCharacter.getExpBonus()));
		this.hpTextPane.setText(String.valueOf(baseCharacter.getHP()));
		
		this.strengthTextField.setText(String.valueOf(baseCharacter.getAbility(Abilities.Strength)));
		this.intelligenceTextField.setText(String.valueOf(baseCharacter.getAbility(Abilities.Intelligence)));
		this.wisdomTextField.setText(String.valueOf(baseCharacter.getAbility(Abilities.Wisdom)));
		this.dexterityTextField.setText(String.valueOf(baseCharacter.getAbility(Abilities.Dexterity)));
		this.constitutionTextField.setText(String.valueOf(baseCharacter.getAbility(Abilities.Constitution)));
		this.charismaTextField.setText(String.valueOf(baseCharacter.getAbility(Abilities.Charisma)));
		
		this.strengthBonusPanel.setText(String.valueOf(baseCharacter.getAbilityADJ(Abilities.Strength)));
		this.intelligenceBonusPanel.setText(String.valueOf(baseCharacter.getAbilityADJ(Abilities.Intelligence)));
		this.wisdomBonusPanel.setText(String.valueOf(baseCharacter.getAbilityADJ(Abilities.Wisdom)));
		this.dexterityBonusPanel.setText(String.valueOf(baseCharacter.getAbilityADJ(Abilities.Dexterity)));
		this.constitutionBonusPanel.setText(String.valueOf(baseCharacter.getAbilityADJ(Abilities.Constitution)));
		this.charismaBonusPanel.setText(String.valueOf(baseCharacter.getAbilityADJ(Abilities.Charisma)));
		
		this.svPoisonPane.setText(String.valueOf(baseCharacter.getSave(SavingThrow.svPoison)));
		this.svMagicWandPane.setText(String.valueOf(baseCharacter.getSave(SavingThrow.svMagicWand)));
		this.svParalysisPane.setText(String.valueOf(baseCharacter.getSave(SavingThrow.svParalysis)));
		this.svDragonPane.setText(String.valueOf(baseCharacter.getSave(SavingThrow.svDragon)));
		this.svSpellPane.setText(String.valueOf(baseCharacter.getSave(SavingThrow.svSpell)));
	}
	
	private AbstractAction getRollAbilitiesJButton() {
		if(rollAbilitiesJButton == null) {
			rollAbilitiesJButton = new AbstractAction("Roll Abilities", null) {
				public void actionPerformed(ActionEvent evt) {
					for (Abilities a : Abilities.values()) {
						baseCharacter.setAbility(a, die.RollCharacter(4, 6, 1));
						updateAllFields();
					}
				}
			};
		}
		return rollAbilitiesJButton;
	}
	
	private JLabel getHpLabel() {
		if(hpLabel == null) {
			hpLabel = new JLabel();
			hpLabel.setText("HP");
		}
		return hpLabel;
	}
	
	private JTextPane getHpTextPane() {
		if(hpTextPane == null) {
			hpTextPane = new JTextPane();
			hpTextPane.setText(String.valueOf(baseCharacter.getHP()));
		}
		return hpTextPane;
	}
	
	private JLabel getTHAC0Label() {
		if(tHAC0Label == null) {
			tHAC0Label = new JLabel();
			tHAC0Label.setText("THAC0");
		}
		return tHAC0Label;
	}
	
	private JTextPane getTHAC0TextPane() {
		if(tHAC0TextPane == null) {
			tHAC0TextPane = new JTextPane();
			tHAC0TextPane.setText(String.valueOf(baseCharacter.getTHAC0()));
		}
		return tHAC0TextPane;
	}
}
